home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 April / PCgo 2008-04 (DVD).iso / interface / contents / demoversionen_3846 / 13664 / files / Data1.cab / vctcimagetool.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2005-09-27  |  2.6 KB  |  98 lines

  1. // VCTCImageTool.cpp : Implementation of DLL Exports.
  2.  
  3.  
  4. // Note: Proxy/Stub Information
  5. //      To build a separate proxy/stub DLL, 
  6. //      run nmake -f VCTCImageToolps.mk in the project directory.
  7.  
  8. #include "stdafx.h"
  9. #include "resource.h"
  10. #include <initguid.h>
  11. #include "VCTCImageTool.h"
  12.  
  13. #include "VCTCImageTool_i.c"
  14. #include "VCTCImage.h"
  15.  
  16.  
  17. CComModule _Module;
  18.  
  19. BEGIN_OBJECT_MAP(ObjectMap)
  20. OBJECT_ENTRY(CLSID_VCTCImage, CVCTCImage)
  21. END_OBJECT_MAP()
  22.  
  23. class CVCTCImageToolApp : public CWinApp
  24. {
  25. public:
  26.  
  27. // Overrides
  28.     // ClassWizard generated virtual function overrides
  29.     //{{AFX_VIRTUAL(CVCTCImageToolApp)
  30.     public:
  31.     virtual BOOL InitInstance();
  32.     virtual int ExitInstance();
  33.     //}}AFX_VIRTUAL
  34.  
  35.     //{{AFX_MSG(CVCTCImageToolApp)
  36.         // NOTE - the ClassWizard will add and remove member functions here.
  37.         //    DO NOT EDIT what you see in these blocks of generated code !
  38.     //}}AFX_MSG
  39.     DECLARE_MESSAGE_MAP()
  40. };
  41.  
  42. BEGIN_MESSAGE_MAP(CVCTCImageToolApp, CWinApp)
  43.     //{{AFX_MSG_MAP(CVCTCImageToolApp)
  44.         // NOTE - the ClassWizard will add and remove mapping macros here.
  45.         //    DO NOT EDIT what you see in these blocks of generated code!
  46.     //}}AFX_MSG_MAP
  47. END_MESSAGE_MAP()
  48.  
  49. CVCTCImageToolApp theApp;
  50.  
  51. BOOL CVCTCImageToolApp::InitInstance()
  52. {
  53.     _Module.Init(ObjectMap, m_hInstance, &LIBID_VCTCIMAGETOOLLib);
  54.     return CWinApp::InitInstance();
  55. }
  56.  
  57. int CVCTCImageToolApp::ExitInstance()
  58. {
  59.     _Module.Term();
  60.     return CWinApp::ExitInstance();
  61. }
  62.  
  63. /////////////////////////////////////////////////////////////////////////////
  64. // Used to determine whether the DLL can be unloaded by OLE
  65.  
  66. STDAPI DllCanUnloadNow(void)
  67. {
  68.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  69.     return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
  70. }
  71.  
  72. /////////////////////////////////////////////////////////////////////////////
  73. // Returns a class factory to create an object of the requested type
  74.  
  75. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  76. {
  77.     return _Module.GetClassObject(rclsid, riid, ppv);
  78. }
  79.  
  80. /////////////////////////////////////////////////////////////////////////////
  81. // DllRegisterServer - Adds entries to the system registry
  82.  
  83. STDAPI DllRegisterServer(void)
  84. {
  85.     // registers object, typelib and all interfaces in typelib
  86.     return _Module.RegisterServer(TRUE);
  87. }
  88.  
  89. /////////////////////////////////////////////////////////////////////////////
  90. // DllUnregisterServer - Removes entries from the system registry
  91.  
  92. STDAPI DllUnregisterServer(void)
  93. {
  94.     return _Module.UnregisterServer(TRUE);
  95. }
  96.  
  97.  
  98.